home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / iqb9109.zip / CVTMBF.BAS < prev    next >
BASIC Source File  |  1991-09-09  |  620b  |  22 lines

  1. ' CvtMBF.BAS
  2. ' Functions to convert to and from IEEE and Microsoft Binary format numbers
  3. '
  4.  
  5. FUNCTION IEEE2MBF (A AS SINGLE)
  6. ' Convert IEEE-format single-precision numbers to MBF
  7. DIM mbfSingle AS TrickSingle
  8. DIM SingleCVBuf AS SingleMBFStr
  9. SingleCVBuf.Bytes = MKSMBF$(A)
  10. LSET mbfSingle = SingleCVBuf
  11. IEEE2MBF = mbfSingle.Bytes
  12. END FUNCTION
  13.  
  14. FUNCTION MBF2IEEE (A AS SINGLE)
  15. ' Convert Microsoft Binary format single-precision numbers to IEEE
  16. DIM mbfSingle AS TrickSingle
  17. DIM SingleCVBuf AS SingleMBFStr
  18. mbfSingle.Bytes = A
  19. LSET SingleCVBuf = mbfSingle
  20. MBF2IEEE = CVSMBF(SingleCVBuf.Bytes)
  21. END FUNCTION
  22.